home *** CD-ROM | disk | FTP | other *** search
- Path: news.cc.uic.edu!sunphy1!olczyk
- From: olczyk@sunphy1 (Thadeus Olczyk)
- Newsgroups: comp.lang.c++,comp.lang.pascal.delphi.misc
- Subject: Re: C++ with Zapp vs. Delphi
- Followup-To: comp.lang.c++,comp.lang.pascal.delphi.misc
- Date: 16 Jan 1996 07:09:46 GMT
- Organization: University of Illinois at Chicago
- Message-ID: <4dfivq$34fs@tigger.cc.uic.edu>
- References: <4coar6$d4n@sun4.bham.ac.uk> <4coip7$69s@news1.usa.pipeline.com> <fRA+w0JfFG5X089yn@oslonett.no> <4dcc4d$6anc@tigger.cc.uic.edu> <4ddke3$5lf@fountain.mindlink.net>
- NNTP-Posting-Host: sunphy1.phy.uic.edu
- X-Newsreader: TIN [version 1.2 PL2]
-
- Brent Bysouth (brent_bysouth@mindlink.bc.ca) wrote:
- : You don't seem to understand the significance of RTTI in Delphi. You
- As far as I understand RTTI in Delphi, it is a slightly weaker version
- of the C++ version. If so then it considered bad practice -- violating
- the open/close principle. If not then Borland had better clean up their
- documentation because I have never seen any mention of it.
-
- : can execute methods and set/get properties by name lookup -- ie.
- : dynamic method resolution similar to what's in ObjectiveC & Smalltalk.
- : Delphi's VCL makes extensive use of this when components are streamed
- At first I thought you might have a point, but if you mean what goes on
- in TPersistent then it's complexity (which is imposed by the nature of Delphi)
- proves my point. Can you give an example?
- If it's what I think you are saying, then it is not similar to ObjC or
- SmallTalk. It's a lot more complicated and error prone.
-
- : in from form files. Also, through the use of virtual constructors and
- : class references (ie. metaclasses), you can write generic code that
- : constructs objects of unknown subtypes. I've personally used these
- : things to implement a pseudo-late binding class "factory" that you can
- : load from DLLs.
- Again I would like to see an example. Especially since you don't use classes
- in the iterface to a Dll.
-
- : Given many of Delphi's RAD competitors, I can see why RAD has a bad
- : name. Delphi is popular because it is a 'second-generation' RAD tool,
- : and eliminates many of the problems of first generation RAD tools.
- Strange considering the prime complaints about RAD are:
- 1) Analysis and design are given short shrift, leading to bad architecture
- and major difficulty when complexity rises.
- 2) Pressure to accept a prototype for final product. This is going to
- be especially nasty in Win95 and NT.
-
- : Yes, I agree that cutting & pasting code brings on maintenance
- : nightmare. I'm less sure that a lack of MI does though, as would many
- If the lack of MI causes cutting and pasting then a lack of MI does bring
- maintenance problems. That's my arguement.
-
- : others. MI vs. SI is an age old argument, and you're not going to get
- : a concensus on it anytime soon. If you really want a discussion on
- : it, start a thread in comp.object!
- MI vs SI is not an old arguement. Statically typed MI (Eiffel,C++) vs.
- dynamically typed SI (ObjC, Smalltalk) is an old arguement. I have never
- seen a thread on comp.object which argued that statically typed SI beats
- statically typed SI(Delphi).
-
- Of course if your first point is correct...
-
- : >: >Maybe C vs. Pascal , but C++ is OO and Object Pascal is a fraud perpetuated by
- : >: >Borland on the world.
-
- : Would you care to elaborate on this one? If you're attempting to say
- : that C++ is more OO than Object Pascal, could you back this up?
- Same as above.
- I would point out that just because a language has all the OO features
- described in books, that does not make it OO. If I have all the parts
- for a car, but they don't fit together (different brands of car)
- well enough for the "car" to run,
- I don't really have a car do I? The same with OO languages. The features
- have to work together.
-
- : >If MI is not so great why does Borland simulate it in the VCL? Did you notice
- : >that I pointed this out?
-
- : I think all of us noticed you saying that. Please support it though --
- : give examples of where Borland simulated MI in the VCL. However,
- : don't confuse MI with delegation (which at least Object Pascal and
- : Objective C support and encourage) and association (do any mainstream
- : languages support this as a language feature?).
- It has been a while (two months since I looked at the source), but look
- at the FList in TStrings or FDataLink in the DB classes. I will have to
- take a closer look ( I can't right now ) before fully committing myself.
- A bit of a trade off here. My example for your example no?
-
- : Are you commenting on unit level access to protected and private
- : variables (ever heard of friends in C++?) ? Please clarify...
- (Sorry bad editing on my part.)
- Take an object Controler which contains a TList. In the TList I want to
- store classes MyA, MyB,MyC ... which are A,B,C ... with the extra method
- foo. If you have multiple inheritence make an ABC with foo as the only method
- and store the ABC, derive MyA from A and the ABC. In Delphi you have to--
- 1) Store each class and use RTTI -- violation of the open/closed principle.
- 2) Store a function pointer to foo ( fake multiple inheritence).
-
- Of course if you can use delegation, that's another thing. But then that seems
- to be the meat of the whole arguement.
-
- : >Add to the other weaknesses of Delphi the fact that you can instantiate
- : >abstract classes. How good is a language which allows you to make a
- : >contract and then break it.
-
- : I've often wondered myself why you can instantiate abstract classes.
- : However, if you're coming from a C++ background, I think it's a bit
- : hypocritical to make the second statement that you did. Why not talk
- : about C++'s problems wrt its VMT? Ie.
-
- : - C++ objects are not binary compatible across compiler
- : implementations
- A bit hypocritical to bring up this particular problem considering
- that Delphi can't possibly have it, there being only one compiler
- implementation (which is not really true as TP object files are not
- compatible with dcu's). I've rarely seen two different compilers which
- were compatible with each other.
-
-
- : - changes in C++ objects that affect the VMT mean that code accessing
- : that object must be recompiled (can this be classified as a
- : "maintenance nightmare"?). This is probably C++ worst problem -- it
- : gets to the point where DLLs compiled from C are more reliable and
- : reusable than those from C++.
- This is a choice of compiler writers.
- If people really want this fixed, they will fix it.
- I personally prefer it this way, it produces faster code and makes me work
- hard to minimise my dependencies.
-
- : BTW, Delphi has a VMT but also supports a dynamic method table that
- : gets around this problem (ie: methods declared with the dynamic and
- : message directives).
- At the cost of speed. See above.
-
- : I classify properties as a nice-to-have (but non-essential) feature.
- : I classify MI as the same -- Object Pascal & Smalltalk surely seem to
- : get by alright without them. (Or at least you haven't proven
- : otherwise).
-
- : And yes, if you want container classes, you can construct them using
- : Delphi's RTTI and class objects. They wouldn't be a compiler-known
- : entity (ie. they wouldn't have full static typechecking), but you
- : certainly can do them.
- Ah, but such lasses are already a part of the C++ library (STL), and
- though most implementations don't conform to the standard ( another
- plus, ask any OWL programmer ) every PC compiler comes with such. you
- can also purchase others or get the STL by ftp.
-
- : ---
-
- : Alas, after having said all this, I'm not sure that you're interested
- : more in discussion or in flaming. Your response to Rune seems to
- : indicate the latter.
- -----
- Nope.
- Rune didn't seem interested in reading much of my post.He just
- seemed interested in pushing properties as the next best thing to white bread.
- Which is another reason why RAD is bad. It leads some managers to think
- "Hey we don't have to hire those crazy bearded C/C++ programmers who do such
- nasty things as insisting on realistic scheduals. Instead we can hire
- those liberal arts major and teach them VB. Just like the good old days with
- COBOL."
- --------------------------------------
- Thaddeus L. Olczyk
-
-
-